package cn.mavor.day0906;

public class Circle {
    public static void main(String[] args) {
        Circleinfo circle = new Circleinfo(5.0);
        System.out.println(circle);
    }
}


class Circleinfo {
    private double radius;
    public Circleinfo(double radius) {
        this.radius = radius;
    }

    public double getRadius() {
        return radius;
    }

    public double getCircumference() {
        return 2 * Math.PI * radius;
    }

    public double getArea() {
        return Math.PI * radius * radius;
    }



    @Override
    public String toString() {
        return "圆的信息：{" +
                "半径=" + getRadius() +
                ", 周长=" + getCircumference() +
                ", 面积=" + getArea() +
                '}';
    }
}